home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
sharefix.zip
/
sharefix.doc
< prev
next >
Wrap
Text File
|
1993-12-27
|
8KB
|
186 lines
************************************************************************
** SHAREFIX.DOC - short and dirty documentation to SHAREFIX **
** **
** (c) 1993 Andrzej Górbiel **
************************************************************************
What is SHAREFIX?
It is a set of tools that fix many problems resulting from usage of SHARE
with most old DOS applications in multitasking environment (e.g. Windows).
I would never use SHARE on my single user, isolated computer because
it takes some memory and causes many troubles but there are some programs
that cannot work without SHARE (e.g. Microsoft Word for Windows 6.0!).
There are two unpleasant things about SHARE:
1. If a process dies before closing file it will remain open and LOCKED
forever i.e. until you reboot. And I believe you will agree that
booting PC with lots of drivers, TSRs, multiple configurations utils,
virus scanners and Windows itself is not a funny job!
2. Most traditional DOS applications open files in the so called
"compatibility mode" (without sharing flags) that means:
- once file is opened such way it cannot be open for sharing
e.g. Windows is unable to read such file
- once file is open for sharing it cannot be open in compatibility
mode even if process that open for sharing allows others read and write!
This means:
* you cannot view any file that is used by Windows
* you cannot copy even a font file that is loaded
* it is dangerous to search any information using DOS utils
because they will issue a critical error each time they
try to access Windows executable, DLL, driver, font file
or any document that is open
* you can get a heart attack because some of DOS programs
will suggest you formatting your hard disk
I have observed still other problems with SHARE:
- some older programs written in Turbo Pascal exit with "Runtime error"
with a number corresponding to "invalid file handle"; anyway I would
suggest to recompile such programs but it is not possible if you
have no sources
- some DOS programs that keep data files or configuration files open
cannot be started in two DOS sessions; sometimes you should not do that
but in many cases it is quite normal
All problems described above will be (hopefully!) fixed by one of
the following tools:
--------
SHAREDIR
--------
This program displays detailed list of files maintained by SHARE. This is
not the same list that some other tools (e.g. Quarterdeck's Manifest) show.
You can find from this list which file became open and locked forever.
Example of output produced by SHAREDIR:
PATH LOCKS MODE VM
------------------------------------------------------------------------------
C:\NC\NC.INI 0 0042 2
C:\WINDOWS\SYSTEM\WINOA386.MOD 0 1042 1
C:\WINDOWS\SYSTEM\DOSAPP.FON 0 1042 1
C:\WINDOWS\SYSTEM\KRNL386.EXE 0 1042 1
WIN$EXEC 0 00C0 1
C:\WINDOWS\SYSTEM\W800.DRV 0 1042 1
C:\WINDOWS\SYSTEM\COURP.TTF 0 1042 1
C:\WINDOWS\SYSTEM\USER.EXE 0 1042 1
First column is a fully qualified canonical name of file (all SUBSTs,
ASSIGNs, JOINs are resolved) unless a file is a character device
(in this example WIN$EXEC).
Second column is a number of LOCKS (number of locked regions in file).
Not many programs use locks but I had a lot of problems with Word 6.0
before I found that it cannot save documents in its new format
if you do not give it at least a hundred of locks (SHARE /L:100).
Third column is not even undocumented but it seems to have something
to do with DOS open mode (less significant byte).
The last column is a identifier of Virtual Machine that opened a file.
Under Windows 3.1 it is 0-for resident DOS (you should not see it often!),
1-for Windows, >=2-for all other DOS sessions. Beware: if you kill a DOS
session its number will be reused soon making you think that some forgotten
file was open by innocent DOS program.
-----
CLOSE
-----
This command allows you to close file by its name. You will no longer
have to reboot after some files remain open forever. If you decide
to close a file just pick its name from a list of files printed
by SHAREDIR. Please use complete path unless file is in a current
directory. CLOSE will resolve all SUBSTs for you. If you want to
close device driver type use a colon after its name. You will not
probably be able to close standard character devices (e.g. NUL, CON)
but you can try if you like.
BEWARE:
If you close a file that is still in use by some applications you
can run in to trouble because this programs will continue to read
and DOS will not signal an error but frankly provide them with
random bytes. And what will happen after write request? (not tested)
--------
SHAROPEN
--------
This is a very small TSR (30 bytes of code+PSP) that makes all DOS
programs to act "SHARE aware". They will no longer open files
in compatibility mode but use "deny write" mode. This should be
very safe solution and it will allow you to open for reading
most of files used by Windows. I could use "deny none" mode
but this much more dangerous and rarely needed. But if you like it
just find the only OR instruction and change its bit mask.
Notes:
Threre is a problem with Borland C++ 3.1 and TSRs that hook INT 21.
This is NOT a BUG in SHAROPEN! The workaround is to start SHAROPEN
via INSTALL derective from CONFIG.SYS possibly before all memory
managers and other resident software.
The SHAROPEN has not code to detect itself in memory. Nothing wrong
happens when loaded more than once but this is just wasting of memory.
There is also problem with Norton Commander 4.0 "save setup" if
SHAROPEN is loaded. No workaround available. Maybe in future versions
I will include an option allowing SHAROPEN to recognize requests from
incompatybile programs and process them normally.
If you know any other problems E-mail me.
****************************************************************************
DISCLAIMER:
As you did not purchase this programs from me you can use them only
>>>> A T Y O U R O W N R I S K <<<<
So don't bother me with your E-mails, letters, phone calls and
your lawyers if anything happens to your valuable data.
****************************************************************************
LICENCE:
This is FREE SOFTWARE. Use and distribute freely. If you want to enhance
anything do not hesitate to do so. Never remove my copyright; include
yours and write what changes you have made.
If you find that one of these programs helped you solve your problem
please go to the nearest computer store, buy a good 3 1/2" floppy,
place a stamp on it and send to the address below. I believe this
is not to much for you. I can buy only 40 diskettes with my grant
(although I have one of the highest grants in Poland).
If you feel you need sources I can send them via E-mail. But please
make sure you need them. SHAROPEN and CLOSE are written in assembler
and are small enough to be successfully disassembled. My sources
do not contain a single line of comment! SHAREDIR consist of 20 lines
of C code and is not commented either. It is so big after compilation
because I use "printf" and original C0C.OBJ (Borland C++ 3.1).
*****************************************************************************
ADDRESS:
Please note that my E-mail address will be valid only until summer 94.
gorbiel@uci.agh.edu.pl
s645@ernie.icslab.agh.edu.pl
And